// 不同后缀的文件对应的展示的图标类型
const FILE_ICON = new Map([
  // 图片
  [
    ["png", "jpg", "svg", "webp", "bmp"],
    {
      type: "image",
      icon: require("@/assets/formIcon/tp.svg")
    }
  ],
  // 音频
  [
    ["amr", "mp3"],
    {
      type: "audio",
      icon: require("@/assets/formIcon/voice-ext.svg")
    }
  ],
  //视频
  [
    ["mp4","mov","avi"],
    {
      type: "video",
      icon: require("@/assets/formIcon/vidoe-ext.svg")
    }
  ],
  // word
  [
    ["dox", "docx"],
    {
      type: "file",
      icon: require("@/assets/formIcon/WORD.svg")
    }
  ],
  // EXCEL
  [
    ["xlsx", "xls"],
    {
      type: "file",
      icon: require("@/assets/formIcon/Excel.svg")
    }
  ],
  //压缩文件
  [
    ["zip", "tar", "rar"],
    {
      type: "file",
      icon: require("@/assets/formIcon/ysb.svg")
    }
  ],
  //文档
  [
    ["txt"],
    {
      type: "file",
      icon: require("@/assets/formIcon/txt-ext.svg")
    }
  ],
  // 表明位置文件
  [
    ["*"],
    {
      type: "file",
      icon: require("@/assets/formIcon/unknown-ext.svg")
    }
  ]
]);


//拆解文件类型图标对应表
let FILE_MAP_ICON: any = {};
for (let [key, value] of FILE_ICON.entries()) {
  for (let x of key) {
    FILE_MAP_ICON[x] = value;
  }
}

export { FILE_ICON, FILE_MAP_ICON };